SetGlobalTimerInterval
Definition:
SetGlobalTimerInterval(interval)
Description:
Enable and disable the Global Timer and specify the time interval
Platforms:
All
Parameters:
interval - required
Time period in milliseconds.
To stop the Global Timer, set the interval parameter to 0. To start the Timer again specify a time interval here greater than 0.
Returns:
nothing
Notes:
Each Digitise app has a Global Timer which can run automatically throughout the app and trigger the OnTimer Event at your defined time interval. This allows you to perform a series of actions at regular intervals throughout the running of the app without needing to add a Timer Control to your forms. When the Global OnTimer Event is triggered any Script assigned to the Event will run.
By default, the Global Timer is turned off and does not run. To turn the Timer On you need to specify the time interval at which you want it to trigger the OnTimer Event. You can do this using the Project Properties or programmatically within your Scripts.
To specify a time interval in the Project Properties right-click on the root node or whitespace areas in the Forms or Data Sources Panes and choose Project Properties. Edit the Interval Property under the Global Timer category and specify the time interval you want in milliseconds.
To enable the Timer programmatically, call the SetGlobalTimerInterval Method within a Script.
To disable the Timer simply set the time interval to zero, either in the Interval Property or using SetGlobalTimerInterval within a Script.
Once enabled, the Timer will continue to run, whichever forms display, until you disable it again. Please note, that the Global Timer doesn't switch itself off if an error occurs, unlike the Timer Control.
- You should use the Global Timer cautiously so as not to adversely affect the performance of your App Server or app. Make sure you are not initiating actions or data transfers too frequently or unnecessarily, especially if your app will be used by a large number of users. If you want to automatically download data to your devices, consider incorporating a mechanism which allows you to check that new data is available to prevent frequent unnecessary downloads of a database which hasn't changed.
See also: